const commodityDao = require("../dao/commodityDao");

module.exports.find=async function(searchObj,page){
  return  await commodityDao.find(searchObj,page)
}

//根据所有id查询
module.exports.findById = async function (id) {
    try {
        return await commodityDao.findById(id)
    } catch (e) {
        return {}
    }
}
//增加
module.exports.insert = async function (commodity) {
    return await commodityDao.insert(commodity)

}
//根据
module.exports.delete = async function (id) {
    return await commodityDao.delete(id)
}
// 修改
module.exports.update = async function (id, commodity) {
    return await commodityDao.update(id, commodity)
}